<?php
declare (strict_types = 1);

namespace app\middleware;

class Log
{

    /**
     * 记录请求日志
     * @param \think\Request $request
     * @param \Closure $next
     * @return \Closure
     */
    public function handle($request, \Closure $next)
    {
        //Source：mini,android,ios,h5
        //记录日志
        /*if(app('http')->getName() === 'index') {
            $log['url'] = $request->url();
            $log['ip'] = $request->ip();
            $log['source'] = $request->header('Source');
            $log['user_agent'] = $request->header('user-agent');
            $log['create_at'] = date('Y-m-d H:i:s');
            Db::name('system_log')->insert($log);
        }*/
        return $next($request);
    }
}
